using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;
namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class NewsImageMap : EntityTypeConfiguration<NewsImage>
    {
        public NewsImageMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.ImageType)
                .HasMaxLength(50);

            this.Property(t => t.IsShow)
                .IsFixedLength()
                .HasMaxLength(1);

            // Table & Column Mappings
            this.ToTable("NewsImage");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.ImageData).HasColumnName("ImageData");
            this.Property(t => t.ImageType).HasColumnName("ImageType");
            this.Property(t => t.ImageSize).HasColumnName("ImageSize");
            this.Property(t => t.IsShow).HasColumnName("IsShow");
        }
    }
}
